package com.audaque.springboot.foshanupload.cloudauthtrans.filter;

import com.audaque.springboot.foshanupload.authcore.model.currentUser.TransmittableThreadLocalCurrentUser;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.*;
import java.io.IOException;

/**
 * @author zgb
 * @desc ...
 * @date 2023-07-11 19:28:46
 */
@Slf4j
public class TransmittableThreadLocalCurrentUserRemoveFilter implements Filter {
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        chain.doFilter(request, response);
        return;
    }

    @Override
    public void destroy() {
        log.debug("在过滤器清除上下文");
        TransmittableThreadLocalCurrentUser.remove();
    }
}
